/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.crm.controller;

import java.sql.Blob;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
import queenb.net.entitybean.K100;
import queenb.net.entitybean.K950V;
import queenb.net.entitybean.N100;
import queenb.net.entitybean.N950;
import queenb.net.entitybean.Q400;
import queenb.net.entitybean.T025;
import queenb.web.controller.QueenbController;
import queenb.web.controller.SearchController;
import queenb.web.crm.inteface.K100Inf;
import queenb.web.crm.store.CustomerStore;
import queenb.web.crm.store.K100Store;
import queenb.web.crm.store.K400Store;
import queenb.web.crm.store.K950Store;
import queenb.web.financial.store.T000Store;
import queenb.web.session.PageController;
import queenb.web.store.ContactStore;
import queenb.web.store.EmployeeStore;
import queenb.web.supplier.store.T025Store;
import queenb.web.util.ComboboxUtil;
import queenb.web.util.ContextUtil;
import queenb.web.util.SessionProvider;
import queenb.web.util.Util;

/**
 *
 * @author Nguyen Hung
 */
public class K100Controller extends QueenbController {

    private K100Inf k100Inf;
    private int PK100;//MA KHACH HANG
    private int FH200;  // THUOC CONG TY
    private int FK200;//LOAI DANG KY(CMND,PASSPORT)
    private int FK250;//PHAN LOAI KHACH HANG
    private int FK300 = 1;//Nguồn thông tin
    private int FK400;//BAN NGANH
    private int FK350;//NHOM KHACH HANG
    private String KV101;//DIEN GIAI
    private String KV102;//MA SO KHACH HANG
    private String KV103 = "";
    private String KV104;
    private String KV105;
    private String KV106;// VIet tat
    private String KV107;// mã số thues
    private String KV108;
    private String KV109;
    private String KV110 = "2";
    private String KV111;
    private String KV112;
    private byte[] KB113;
    private Blob logo;
    private int KN114 = 1;
    private int FH200Q;
    private int FH150;
    private int FV350;
    private String KL197;
    private K100Store k100Store = new K100Store();
    private List<K100> list = new ArrayList<K100>();
    private int FN850;
    private int FN900;
    private String flag = "";
    private int FN550;
    private int beginContructor;
    private int ni105;
    private int pn100;
    private int edit = 0;
    private List<SelectItem> combN850 = new ArrayList<SelectItem>();
    private List<SelectItem> combN900 = new ArrayList<SelectItem>();
    private List<SelectItem> combN550 = new ArrayList<SelectItem>();
    private List<SelectItem> combN550CC = new ArrayList<SelectItem>();
    ComboboxUtil comboboxUtil = new ComboboxUtil();
    private String idSearch;
    private String charSearch;
    private String keySearch;
    private int typeSearch;
    private List<Q400> listQ400;
    private int pk100;
    // Tung edit 
    private String messagecom;
    private int pn950;//id n950
    private String nv958;//Phone
    private String nv961;//mobiphone;
    private String nv967;//tel
    private String nv968;//sky
    private String nv969;//yahoo
    private String nv952;//diachi
    private String nv955;//Quan/Huyen
    private String nv957;//tinh thanh
    private String nv960;//note
    private String nv954;// address 2
    private String nv962;//email
    private String nv973;// Email 1
    private String nv974;// Email  2
    private String nv975;//email 3
    private String TV026;
    private String TV027;
    private String TV028;
    private String TV029;
    private String TV030;
    private int pt025;
    private String searchString = "Nhập từ khóa";
    private List<N100> listExpand = new ArrayList<N100>();
    // the end
    private List<SelectItem> listComboK300 = new ArrayList<SelectItem>();
    private List<SelectItem> listComboK330 = new ArrayList<SelectItem>();
    private List<SelectItem> listCoutry = new ArrayList<SelectItem>();
    private List<SelectItem> listCity = new ArrayList<SelectItem>();
    //private int FK300;// id nguồn thông tin
    private int FK330 = 1;// id status
    //paging
    private int Offset = 0;
    private int Limit = 30;
    private int totalrow; // tong so dong
    private int totalpage; // tong so trang
    private int current; // traung hien tai
    static private int numrow = 30; // so dong tren 1 trang
    private int start; // bat dau lay tu record
    private int end; // lay tu record so
    private int startpage = 1; // page bat dau
    private int endpage = 1;   // page ket thuc
    private String pagename = "";
    private int totalcurent;
    private int typesearchcurent;
    // 29/11 Tung Start --> Thêm nhóm cho khách hàng công ty
    private int fk400;
    private String kv451;
    private int groupID;
    private boolean select;// khach hang la doi tac hay nha cung cap
    private int tip;
    private int fn850gt;// Phong ban
    private List<SelectItem> groupOther;
    private String pagecurent;
    private int dayss;
    // End Tùng
    private List<SelectItem> lstEmpByID = new ArrayList<SelectItem>();
    private int fn850;
    private int typeSearchNCC;
    private String loginEmp;
    private String userAction;
    private int flagFN850;
    private int FN750;// Quoocs gia cho nha CC
    // ngay tim kiem status
    private Date startDateSta;
    private Date endDateSta;
    private Date KD115;
    private int rowdemo;// getrow 1 ngay
    private String tabString = "TABLL";// phan biet cac tab 

    public K100Controller() {
        if (SessionProvider.getSessionMapValue("groupID") != null) {
            fn850 = Integer.parseInt(SessionProvider.getSessionMapValue("groupID").toString());
        }
        if (SessionProvider.getSessionMapValue("emp") != null) {
            loginEmp = SessionProvider.getSessionMapValue("emp").toString();
            userAction = loginEmp;
            System.out.println("---USER LOGIN----------------------------" + loginEmp + getLogin().getUserName());
        } else {
            loginEmp = getLogin().getUserName();
            System.out.println("---USER LOGIN--------------NO VAO DAY--------------" + loginEmp);
        }
        SearchController searchController = new SearchController();
        idSearch = searchController.searchAlpha_KHCN();
        searchAlphaCompany();

        Object type = getRequest().getParameter("type");
        if (type != null) {
            KN114 = Integer.parseInt(type.toString());

            SessionProvider.setSessionMapValue("companytype", KN114);
            SessionProvider.setSessionMapValue("KV114type", KN114);


        }
        getKapiMenu().setAdmin(false);
        getKapiMenu().setMainmenu1("m122");
        getKapiMenu().setSubmenu3("s3" + (getKN114() + 1));
        Object objPK100 = getRequest().getParameter("pnPK100");
        if (objPK100 != null) {
            PK100 = Integer.parseInt(objPK100.toString());
        }

        Object fn850 = getRequest().getParameter("fn850");
        Object id = getRequest().getParameter("id");
        Object qv101 = getRequest().getParameter("qv101");
        Object nflag = getRequest().getParameter("flag");
        Object action = getRequest().getParameter("action");
        Object objDayss = getRequest().getParameter("dayss");
        if (objDayss != null) {
            dayss = Integer.parseInt(objDayss.toString());
        }
        Object objPK400 = getRequest().getParameter("pk400");
        if (objPK400 != null) {
            fk400 = Integer.parseInt(objPK400.toString());
        }
        if (action != null) {
            if (action.toString().equals("favourite")) {
                Object objPn100 = getRequest().getParameter("pn100");
                Object star_value = getRequest().getParameter("ni105");
                Object objFlag = getRequest().getParameter("flag");
                this.pn100 = Integer.parseInt(objPn100.toString());
                this.ni105 = Integer.parseInt(star_value.toString());
                this.flag = objFlag.toString();
                saveColumnK100();
                System.out.println("-nflag-" + flag + "--objpn100-" + objPn100 + "star_value-" + star_value);
            } else if (action.equals("edit")) {
                if (SessionProvider.getSessionMapValue("PN100HD") != null) {
                    SessionProvider.removeSessionMapValue("pn100HD");
                }
                Object pageObject = getRequest().getParameter("page");
                if (pageObject != null) {
                    this.fk400 = Util.parseInt(pageObject);

                }
                SessionProvider.setSessionMapValue("Fk200", 1);
                list = k100Store.getListTabK100WithID(getLogin().getUserName(), PK100);
                if (list != null && list.size() > 0) {

                    KV101 = list.get(0).getKv101();
                    KV103 = list.get(0).getKv103();
                    KV102 = list.get(0).getKv102();
                    KN114 = list.get(0).getKn114();
                    if (KN114 == 1 || KN114 == 0) {
                        SessionProvider.setSessionMapValue("KN114Update", KN114);
                    }
                    KV104 = list.get(0).getKv104();
                    KV106 = list.get(0).getKv105();
                    KV108 = list.get(0).getKv108();
                    KV110 = list.get(0).getKv110();
                    FN850 = list.get(0).getFn850();
                    FN550 = list.get(0).getFn550();
                    FK300 = list.get(0).getFk300();
                    FK330 = list.get(0).getFk330();
                    FN750 = list.get(0).getFv350();
                    FK200 = list.get(0).getFk200();
                    KD115 = list.get(0).getKD115();
                    if (FK200 == 1) {
                        select = true;
                        SessionProvider.setSessionMapValue("idselect", 1);

                    } else {
                        select = false;
                        SessionProvider.setSessionMapValue("idselect", 1);

                    }
                    FK350 = list.get(0).getFk350();
                    if (FK350 == 1) {
                        SessionProvider.setSessionMapValue("idselect", 0);
                    } else if (FK350 == 2 || FK350 == 4) {
                        SessionProvider.setSessionMapValue("Fk200", 2);
                    }

                }

                System.out.println("--------------T EDIT NCC PN100-----------" + PK100);
            } else if (action.equals("updateK400N")) {
                Object idEmp = getRequest().getParameter("pn100");
                Object idKN450 = getRequest().getParameter("pk400");
                Object StrK451 = getRequest().getParameter("kv401");
                if (idEmp != null) {
                    this.fk400 = Util.parseInt(idKN450);
                    this.pn100 = Util.parseInt(idEmp);
                    this.kv451 = StrK451.toString();
                    updateDeparmentK450(fk400, pn100, kv451);
                }
            } else if (action.equals("getitemvaluePn100")) {
                Object Objectidk100 = getRequest().getParameter("pk100");
                if (Objectidk100 != null) {
                    pk100 = Util.parseInt(Objectidk100);
                    System.out.println("----------------------ID CUA COMPANY WHEN CLICK VAO-------------" + pk100);
                    SessionProvider.setSessionMapValue("PN100HD", pk100);
                }
            } else if (action.equals("select")) {
                Object idselect = getRequest().getParameter("fk200");
                SessionProvider.setSessionMapValue("Fk200", idselect);
                if (Util.parseInt(idselect) == 2 || Util.parseInt(idselect) == 4) {
                    tip = 1;
                    SessionProvider.setSessionMapValue("idselect", tip);
                } else if (Util.parseInt(idselect) == 1) {
                    FK200 = 1;
                    //  System.out.println("------------------" + FK200);
                    SessionProvider.removeSessionMapValue("idselect");
                    tip = 0;
                }



            } else if (action.equals("add")) {
                if (SessionProvider.getSessionMapValue("PN100HD") != null) {
                    SessionProvider.removeSessionMapValue("pn100HD");
                }
                Object pageObject = getRequest().getParameter("page");
                if (pageObject != null) {
                    this.fk400 = Util.parseInt(pageObject);
                }
                Object objectFk350 = getRequest().getParameter("FK350");
                if (objectFk350 != null) {
                    FK350 = Util.parseInt(objectFk350);
                }
                System.out.println("---------------FK350 SAVE NCC------" + FK350);
                SessionProvider.setSessionMapValue("KN114Update", 0);
                SessionProvider.setSessionMapValue("Fk200", 1);
                SessionProvider.removeSessionMapValue("idselect");

            } else if (action.equals("editajaxpage")) {
                Object pk100oObject = getRequest().getParameter("pn100");
                if (pk100oObject != null) {
                    PK100 = Util.parseInt(pk100oObject);
                }

                list = k100Store.getListTabK100WithID(getLogin().getUserName(), PK100);
                if (list != null && list.size() > 0) {
                    fn850gt = list.get(0).getFn850();
                    KV104 = list.get(0).getKv104();

                }

            } else if (action.equals("reloadGroup")) {
                objPK400 = getRequest().getParameter("pk400");
                fk400 = Integer.parseInt(objPK400.toString());
            } else if (action.equals("addnote")) {
                if (SessionProvider.getSessionMapValue("IDTIPTIP") != null) {
                    SessionProvider.removeSessionMapValue("IDTIPTIP");
                }
                Object objNote = getRequest().getParameter("addTip");
                if (objNote != null) {
                    tip = Util.parseInt(objNote);
                    SessionProvider.setSessionMapValue("IDTIPTIP", tip);
                }

            } else if (action.equals("loadGroup")) {
                objPK400 = getRequest().getParameter("pk400");
                fk400 = Integer.parseInt(objPK400.toString());
            } else if (action.equals("linkCom")) {
                typeSearch = 0;
                keySearch = "";
            } else if (action.equals("reloadfordays")) {
                objDayss = getRequest().getParameter("dayss");
                if (objDayss != null) {
                    dayss = Integer.parseInt(objDayss.toString());
                }
                Object objflagFN850 = getRequest().getParameter("flagFN850");
                if (objflagFN850 != null) {
                    flagFN850 = Integer.parseInt(objflagFN850.toString());
                }

            } else if (action.equals("reloadfordays1")) {
                objDayss = getRequest().getParameter("dayID");
                if (objDayss != null) {
                    FH150 = Integer.parseInt(objDayss.toString());
                }
                try {
                    Object objnd131 = getRequest().getParameter("startDTD");
                    if (objnd131 != "") {
                        setStartDateSta(Util.parseDate(objnd131.toString(), "dd/MM/yyyy"));
                    }
                    Object objnd1311 = getRequest().getParameter("endDTD");
                    if (objnd1311 != "") {
                        setEndDateSta(Util.parseDate(objnd1311.toString(), "dd/MM/yyyy"));
                    }
                } catch (Exception e) {
                }


                System.out.println("---------------NGAY THANG LOAD---------------------------" + startDateSta + endDateSta);


            }else if (action.equals("functionSearch")) {
                Object keyStr = getRequest().getParameter("keysearch");
                keySearch = keyStr.toString();

                Object typeint = getRequest().getParameter("typesearch");
                if (typeint != null) {
                    typeSearch = Integer.parseInt(typeint.toString());
                    if (typeSearch == 0) {
                        pagename = "ALL";
                    }
                }
                System.out.println("----------KEY SEARCH-------" + keySearch + "---TYPE---" + typeSearch + "--PAGE---" + pagename);
            }


        }

        if (qv101 != null && id != null && fn850 != null && nflag != null) {
            FN850 = Integer.parseInt(fn850.toString());
            PK100 = Integer.parseInt(id.toString());
            KV104 = qv101.toString();
            flag = nflag.toString();

        }


        //paging
        int a;
        // System.out.println("D:-- listEmployee is not null fk400--" + fk400);
        Object ppage = getRequest().getParameter("p");
        if (ppage != null) {
            try {
                a = Integer.parseInt(ppage.toString());
            } catch (Exception ex) {
                a = 1;
            }
            if (a == 1) {
                setCurrent(1);
                setOffset(0);
                //    System.out.println("D:-- setOffset: " + 0);
            } else {
                setCurrent(a);
                setOffset((a - 1) * Limit);
                System.out.println("D:-- setOffset: " + ((a - 1) * Limit));
            }
            //   System.out.println("D:-- page: " + a);

        } else {
            SessionProvider.setSessionMapValue("typeSearchK100", null);
            SessionProvider.setSessionMapValue("keySearchK100", null);
            setCurrent(1);
            setOffset(0);
            //  System.out.println("D:-- page: 1");
        }

//        Object npage = getRequest().getParameter("page");
//        if(npage != null){
//            pagecurent = npage.toString().trim();
//        }else{
//            pagecurent = "login";
//        }

    }

    public List<K100> getListImage(int pk100) {
        return k100Store.getListTabK100WithID(getLogin().getUserName(), pk100);
    }

    public void updateDeparmentK450(int idfk450, int idpn100, String kv451Str) {
        try {
            K400Store store = new K400Store();
            int count = store.updateK450(idfk450, idpn100, "N100", "KH LE", getLogin().getUserName());
            //  System.out.println("---------- Nguye tung--" + count);
        } catch (SQLException ex) {
            Logger.getLogger(K100Controller.class.getName()).log(Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            Logger.getLogger(K100Controller.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            Logger.getLogger(K100Controller.class.getName()).log(Level.SEVERE, null, ex);
        }

    }

    public void saveEmpintroduction() {
        try {
            CustomerStore customerStore = new CustomerStore();
            //  System.out.println("---------- RESULT TUNG -----------" + KV104 + PK100);
            int rs = customerStore.updateColumnN100(null, "K100", "KV104", KV104, "PK100", PK100, getLogin().getUserName());
            if (rs > 0) {
                setMessagecom(getResourceString("success"));
            } else {
                setMessagecom(getResourceString("error"));
            }
            //  System.out.println("---------- RESULT TUNG -" + rs);
        } catch (Exception e) {
        }
    }

    public void saveK100() {

        K100Store store = new K100Store();
        int roweffect = 0;
        if (KV104 == null || KV104.equals("0")) {
            KV104 = getLogin().getUserName();
        }
        if (KV102 == null || KV102.equals("0") || KV102.equals("")) {
            KV102 = getLogin().getUserName();
        }
        String dateStart1 = ContextUtil.getRequestParameter("leavedate11");
        try {
            if (dateStart1 != null) {
                setKD115(Util.parseDate(dateStart1, "dd/MM/yyyy"));

            } else {
                // setNd118(null);
            }
        } catch (Exception e) {
        }

        String kv106 = Util.UnUnicode(this.KV103);
        String kv107 = Util.UnUnicode(this.KV106);

        if (KV103 == null || KV103.equals("")) {
            setMessagecom("Tên công ty không bỏ trống!!");
        } else if (select == true) {
            FK200 = 1;
        } else {
            FK200 = 0;
        }

        if (Util.parseInt(SessionProvider.getSessionMapValue("Fk200")) == 1) {
            FK200 = 1;
        }

        if (SessionProvider.getSessionMapValue("KN114Update") != null) {
            KN114 = Util.parseInt(SessionProvider.getSessionMapValue("KN114Update"));

        }
        if (FK300 == 0 || FK330 == 0) {
            setFK300(1);
            setFK330(1);
        }
        roweffect = store.updateK100By(
                this.PK100, getLogin().getModule(), 0, getLogin().getCompanyNo(), FK200, "CN", this.FK300, this.FK330,
                FK350, 0, this.KV101, this.KV102, this.KV103, this.KV104, this.KV106, kv106, kv107, this.KV108,
                "", KV110, "", "", KN114, Util.toSQLDate(KD115), 0, getFN750(), getFN550(), getLogin().getUserName());

        if (roweffect > 0) {
            SessionProvider.removeSessionMapValue("PKKKK");
            //   SessionProvider.removeSessionMapValue("KN114Update");
            PK100 = roweffect;
            SessionProvider.setSessionMapValue("PK100SS", PK100);

            setMessagecom(getResourceString("success"));
        } else {
            setMessagecom(getResourceString("error"));
        }
        //showGlobalReport(true, getResourceString("datasavesuccessful"));
        //sendRedirect("cuscompany.jsp?type=" + KN114);
    }

    public void search(ActionEvent ac) {

        //   System.out.println("---search groupppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp" + charSearch);
        SessionProvider.setSessionMapValue("search4cuscompany", charSearch);

    }

    public void changeCombN850forN900(ActionEvent ac) {
        System.out.println("HELLO------------------------- : " + FN850);
        combN900 = comboboxUtil.getSelectedN900Comb(FN850);

    }

    public void reload() {
        // System.out.println("-----------KEY --- OPITON" + getKeySearch() + getTypeSearch());
        try {
            SessionProvider.setSessionMapValue("submitSearch", "false");
            SessionProvider.setSessionMapValue("typeSearchK100", typeSearch);
            SessionProvider.setSessionMapValue("keySearchK100", keySearch);
            System.out.println("------KHI CLICK VAO TIM KIEM CUA KH CONG TY----" + typeSearch + "-------KEY---" + keySearch);
            sendRedirectUrlTab("cuscompany.jsp?action=functionSearch&keysearch=" + keySearch + "&typesearch=" + typeSearch);
        } catch (Exception e) {
        }

    }

    public List<Q400> getListGroupQ400() throws SQLException, InstantiationException {
        try {
            K400Store k400Store = new K400Store();
            if (getListQ400() == null) {
                setListQ400(k400Store.CombK400(getLogin().getModule(), getLogin().getCompanyNo(), 0, getLogin().getUserName()));
            }

            return getListQ400();
        } catch (IllegalAccessException ex) {
            // java.util.logging.Logger.getLogger(CustomerController.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    public List<Q400> getListQK400Filter() throws SQLException, InstantiationException {
        K400Store k400Store = new K400Store();
        List<Q400> listQ400SK = (List<Q400>) SessionProvider.getSessionMapValue("listQ400SK");
        if (listQ400SK == null) {
            try {
                //   System.out.println("-----------------group k4ooo-------" + getLogin().getModule() + "," + getLogin().getCompanyNo() + "," + getLogin().getId() + "," + 0 + "," + "K100" + "," + getLogin().getUserName());
                listQ400SK = k400Store.COMBTABK400F(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getId(), 0, "K100", getLogin().getUserName());

            } catch (IllegalAccessException ex) {
                // java.util.logging.Logger.getLogger(CustomerController.class.getName()).log(Level.SEVERE, null, ex);
                return null;

            }
        }
        SessionProvider.setSessionMapValue("listQ400SK", listQ400SK);
        return listQ400SK;
    }

    public List<K100> getListK100forday() {
        try {
            list = k100Store.getListCompany_ALL(getLogin().getModule(), getLogin().getCompanyNo(), PK100, FK350, fk400, KN114, keySearch, Offset, 30, 0, 0, userAction);
            setRowdemo(list.size());
            System.out.println("---------------ROW------" + rowdemo);
            return list;
        } catch (Exception e) {
            return null;
        }
    }

    public List<K100> getListK100() {
        int flags = 0;
        int flag1 = 0;
        int flag2 = 0;
        try {
            if (SessionProvider.getSessionMapValue("submitSearch") != null && SessionProvider.getSessionMapValue("submitSearch").toString().equals("true")) {
                setTypeSearch(0);
            }
            Object o = SessionProvider.getSessionMapValue("typeSearchK100");
            if (o != null) {
                int type;
                try {
                    type = Integer.parseInt(o.toString());
                } catch (Exception e) {
                    type = 0;
                }
                setTypeSearch(type);
            }
            Object o2 = SessionProvider.getSessionMapValue("keySearchK100");
            if (o2 != null) {

                setKeySearch(o2.toString());

            }
            if (getKeySearch() != null && getKeySearch().contains("Nhập từ khóa")) {
                setKeySearch(getLogin().getCharacter());
            }
            K100 n100;
            if (getTypeSearch() == 1) {
                list = k100Store.getListCompany_NA(getLogin().getModule(), getLogin().getCompanyNo(), keySearch, Offset, Limit, 0, 0, getLogin().getUserName());
                flags = 1;
            } else if (getTypeSearch() == 2) {
                list = k100Store.getListCompany_MO(getLogin().getModule(), getLogin().getCompanyNo(), keySearch, Offset, Limit, 0, 0, getLogin().getUserName());
                flags = 2;
            } else if (getTypeSearch() == 3) {
                list = k100Store.getListCompany_ALL(getLogin().getModule(), getLogin().getCompanyNo(), PK100, 2, fk400, KN114, keySearch, Offset, 30, 0, 0, getLogin().getUserName());
                flags = 3;
            } else if (getTypeSearch() == 4) {
                list = k100Store.getListCompany_ALL(getLogin().getModule(), getLogin().getCompanyNo(), PK100, 4, fk400, KN114, keySearch, Offset, 30, 0, 0, getLogin().getUserName());
                flags = 4;
            } else if (getTypeSearch() == 5) {
                list = k100Store.getListCompany_MST(getLogin().getModule(), getLogin().getCompanyNo(), keySearch, Offset, 30, 0, 0, getLogin().getUserName());
                flags = 5;
            } else if (getTypeSearch() == 100) {
                if (SessionProvider.getSessionMapValue("IDFK300STATUSS") != null) {
                    FK330 = Util.parseInt(SessionProvider.getSessionMapValue("IDFK300STATUSS"));
                }
                System.out.print("----------------------THAM SO----------" + getLogin().getModule() + "," + getLogin().getCompanyNo() + "," + pk100 + "," + FK350 + "," + KN114 + "," + FK330 + "," + Util.toSQLDate(startDateSta) + "," + Util.toSQLDate(endDateSta) + "," + Offset + "," + 30 + "," + 0 + "," + 0 + "," + getLogin().getUserName());
                list = k100Store.LISTOFTABK100STA(getLogin().getModule(), getLogin().getCompanyNo(), pk100, FK350, KN114, FK330, Util.toSQLDate(startDateSta), Util.toSQLDate(endDateSta), Offset, 30, 0, 0, getLogin().getUserName());
                flags = 100;
            } else if (getTypeSearch() == 0) {
                flags = 0;
                if (getLogin().getCharacter() != null) {

                    list = k100Store.getListTabK100(getLogin().getCompanyNo(), getLogin().getModule(), this.getPK100(), 1, getLogin().getCharacter(), KN114, Offset, Limit, 0, 0, getLogin().getUserName());
                    flag1 = 1;
                } else {
                    if (FH150 != 0) {
                        System.out.println("---------------NGAY THANG LOAD-----DDDDDĐ----------------------" + startDateSta + endDateSta);
                        list = k100Store.getReport_listoftabK100(getLogin().getModule(), getLogin().getCompanyNo(), FK350, 0, Util.toSQLDate(startDateSta), Util.toSQLDate(endDateSta), Offset, 100, 0, 0, userAction);
                    } else {
                        flag1 = 2;
                        if (SessionProvider.getSessionMapValue("KV114type") != null) {
                            KN114 = Util.parseInt(SessionProvider.getSessionMapValue("KV114type"));
                        }
                        //  System.out.println("----kkkkkkkkkkkkkkkkkkkkkkkk222222222222222" + getLogin().getModule() + "," + getLogin().getCompanyNo() + "," + PK100 + "," + FK350 + "," + fk400 + "," + KN114 + "," + keySearch + "," + Offset + "," + Limit + "," + 0 + "," + 0 + "," + userAction);

                        if (keySearch == null && getDayss() == 0) {
                            System.out.println("MB:------------" + getLogin().getModule() + "," + getLogin().getCompanyNo() + "," + PK100 + "," + FK350 + "," + fk400 + "," + KN114 + "," + keySearch + "," + Offset + "," + 30 + "," + 0 + "," + 0 + "," + userAction);
                            list = k100Store.getListCompany_ALL(getLogin().getModule(), getLogin().getCompanyNo(), PK100, FK350, fk400, KN114, keySearch, Offset, 30, 0, 0, userAction);
                            flag2 = 1;
                        } else if (getDayss() != 0) {
                            System.out.println("MB:-----bbb--");
                            list = k100Store.getListCompany_LDAYS(getLogin().getModule(), getLogin().getCompanyNo(), FK350, dayss, Offset, 100, 0, 0, userAction);
                            flag2 = 2;
                        } else {
                            if(pagename.equals("ALL")){
                                 System.out.println("MB:-----KHI TIM KIEM ALL CUA KH CONG TY------" + getLogin().getModule() + "," + getLogin().getCompanyNo() + "," + 0 + "," + 0 + "," + 0 + "," + keySearch + "," + Offset + "," + 30 + "," + 0 + "," + 0 + "," + getLogin().getUserName());
                            list = k100Store.getListCompany_ALL1(getLogin().getModule(), getLogin().getCompanyNo(), 0, 0, 0, keySearch, Offset, 30, 0, 0, getLogin().getUserName());
                            }else{
                                 System.out.println("MB:-----aa--" + getLogin().getModule() + "," + getLogin().getCompanyNo() + "," + PK100 + "," + FK350 + "," + KN114 + "," + keySearch + "," + Offset + "," + 30 + "," + 0 + "," + 0 + "," + getLogin().getUserName());
                            list = k100Store.getListCompany_ALL1(getLogin().getModule(), getLogin().getCompanyNo(), PK100, FK350, KN114, keySearch, Offset, 30, 0, 0, getLogin().getUserName());
                            }
                           
                            flag2 = 3;
                        }
                    }



                }
            }
            if (Offset == 0) {
                if (list.size() > 0) {
                    n100 = list.get(0);
                    if (n100 != null) {
                       
                             SessionProvider.setSessionMapValue("totalcurentK100", n100.getRowss());
                       
                       
                        //totalcurent = n100.getRowss();
                    } else {
                        SessionProvider.setSessionMapValue("totalcurentK100", 0);
                        //totalcurent = 0;
                    }
                } else {
                    SessionProvider.setSessionMapValue("totalcurentK100", 0);
                    //totalcurent = 0;
                }
            }
        } catch (Exception ex) {
            System.out.println("----------->>>>-+error" + ex.getMessage());
            return null;
        }
        if (list == null) {
            //  System.out.println("-----key type ----" + 7);
            list = new ArrayList<K100>();
        }

        //paging
        int t;
        Object obj = SessionProvider.getSessionMapValue("totalcurentK100");
        if (obj != null) {
            try {
                t = Integer.parseInt(obj.toString());
            } catch (Exception e) {
                t = 0;
            }
            totalcurent = t;
        } else {
            totalcurent = 0;
        }

        setTotalrow(totalcurent);

        //Duy sms
        List<K100> listCus = new ArrayList<K100>();
        if (flags == 1) {
            listCus = k100Store.getListCompany_NA(getLogin().getModule(), getLogin().getCompanyNo(), keySearch, Offset, 10000, 0, 0, getLogin().getUserName());


        } else if (flags == 2) {

            listCus = k100Store.getListCompany_MO(getLogin().getModule(), getLogin().getCompanyNo(), keySearch, Offset, 10000, 0, 0, getLogin().getUserName());
        } else if (flags == 3) {

            listCus = k100Store.getListCompany_ALL(getLogin().getModule(), getLogin().getCompanyNo(), PK100, 2, fk400, KN114, keySearch, Offset, 10000, 0, 0, getLogin().getUserName());
        } else if (flags == 4) {

            listCus = k100Store.getListCompany_ALL(getLogin().getModule(), getLogin().getCompanyNo(), PK100, 4, fk400, KN114, keySearch, Offset, 10000, 0, 0, getLogin().getUserName());
        } else if (flags == 5) {

            listCus = k100Store.getListCompany_MST(getLogin().getModule(), getLogin().getCompanyNo(), keySearch, Offset, 10000, 0, 0, getLogin().getUserName());
        } else if (flags == 0) {
            if (flag1 == 1) {
                listCus = k100Store.getListTabK100(getLogin().getCompanyNo(), getLogin().getModule(), this.getPK100(), 1, getLogin().getCharacter(), KN114, Offset, 10000, 0, 0, getLogin().getUserName());
            } else if (flag1 == 2) {
                if (SessionProvider.getSessionMapValue("KV114type") != null) {
                    KN114 = Util.parseInt(SessionProvider.getSessionMapValue("KV114type"));
                }
                //     System.out.println("----kkkkkkkkkkkkkkkkkkkkkkkk222222222222222" + getLogin().getModule() + "," + getLogin().getCompanyNo() + "," + PK100 + "," + FK350 + "," + fk400 + "," + KN114 + "," + keySearch + "," + Offset + "," + Limit + "," + 0 + "," + 0 + "," + userAction);
                if (flag2 == 1) {
                    listCus = k100Store.getListCompany_ALL(getLogin().getModule(), getLogin().getCompanyNo(), PK100, FK350, fk400, KN114, keySearch, Offset, 10000, 0, 0, userAction);
                } else if (flag2 == 2) {
                    listCus = k100Store.getListCompany_LDAYS(getLogin().getModule(), getLogin().getCompanyNo(), FK350, dayss, Offset, 100, 0, 0, getLogin().getUserName());
                } else if (flag2 == 3) {
                    listCus = k100Store.getListCompany_ALL1(getLogin().getModule(), getLogin().getCompanyNo(), PK100, FK350, KN114, keySearch, Offset, 10000, 0, 0, getLogin().getUserName());
                }
            }
        }
        SessionProvider.setSessionMapValue("ListSMSCustommerCompany", listCus);
        return list;
    }

    // tim kiem status
    public void reloadStatus() {
        try {
            System.out.println("------K330 Status-------------------" + FK330);
            if (FK330 != 0) {
                SessionProvider.setSessionMapValue("IDFK300STATUSS", FK330);
                SessionProvider.setSessionMapValue("typeSearchK100", 100);
                System.out.println("------K330 Status-------------------" + SessionProvider.getSessionMapValue("IDFK300STATUSS") + SessionProvider.getSessionMapValue("typeSearchK100"));
            }
            String dateStart = ContextUtil.getRequestParameter("leavedate111");

            if (dateStart != null) {
                setStartDateSta(Util.parseDate(dateStart, "dd/MM/yyyy"));

            } else {
                // setNd118(null);
            }
            String dateStart1 = ContextUtil.getRequestParameter("leavedate112");

            if (dateStart1 != null) {
                setEndDateSta(Util.parseDate(dateStart1, "dd/MM/yyyy"));

            } else {
                // setNd118(null);
            }
            System.out.println("------NGÀY THÁNG-------" + startDateSta + endDateSta);
        } catch (Exception e) {
        }
    }

    public void reloadStatus1() {
        try {
            System.out.println("------K330 Status-------------------" + FK330);
            if (FK330 != 0) {
                SessionProvider.setSessionMapValue("IDFK300STATUSS", FK330);
                SessionProvider.setSessionMapValue("typeSearchK100", 100);
                System.out.println("------K330 Status-------------------" + SessionProvider.getSessionMapValue("IDFK300STATUSS") + SessionProvider.getSessionMapValue("typeSearchK100"));
            }
            String dateStart = ContextUtil.getRequestParameter("leavedate111");

            if (dateStart != null) {
                setStartDateSta(Util.parseDate(dateStart, "dd/MM/yyyy"));

            } else {
                // setNd118(null);
            }
            String dateStart1 = ContextUtil.getRequestParameter("leavedate112");

            if (dateStart1 != null) {
                setEndDateSta(Util.parseDate(dateStart1, "dd/MM/yyyy"));

            } else {
                // setNd118(null);
            }
            System.out.println("------NGÀY THÁNG-------" + startDateSta + endDateSta);
        } catch (Exception e) {
        }
    }

    public void reloadlist(ActionEvent ac) {
        System.out.println("ActionEvent--0000000000---------------------------------------" + loginEmp);
        try {
            userAction = loginEmp;
            setDayss(0);
            setUserAction(getLoginEmp());
            SessionProvider.setSessionMapValue("typeSearchK100", 0);
            SessionProvider.setSessionMapValue("keySearchK100", null);
            SessionProvider.setSessionMapValue("emp", loginEmp);
            sendRedirect("cuscompany.jsp");
        } catch (Exception e) {
        }

    }

    public void reloadDAYS() {
        try {
            String dateStart = null;
            String dateEnd = null;
            if (!Util.toSQLDate(startDateSta).toString().equals("")) {
                dateStart = Util.toSQLDate(startDateSta).toString().substring(8, 10) + "/" + Util.toSQLDate(startDateSta).toString().substring(5, 7) + "/" + Util.toSQLDate(startDateSta).toString().substring(0, 4);;
            }
            if (!Util.toSQLDate(endDateSta).toString().equals("")) {
                dateEnd = Util.toSQLDate(endDateSta).toString().substring(8, 10) + "/" + Util.toSQLDate(endDateSta).toString().substring(5, 7) + "/" + Util.toSQLDate(endDateSta).toString().substring(0, 4);;
            }


            System.out.println(dateStart + "--------------DAYEEEEEEEEEEE-----------" + dateEnd);
            sendRedirectUrlTab("cuscompanyforday.jsp?action=reloadfordays1&dayID=" + 1 + "&startDTD=" + dateStart + "&endDTD=" + dateEnd);
        } catch (Exception e) {
        }
    }

    public void updateK400() throws SQLException, InstantiationException {
        Object objFk100 = getRequest().getParameter("pk100");
        Object objPk400 = getRequest().getParameter("pk400");

        // System.out.println("------objpn1000----+ objPK400----" + objPk400 + "----" + objFk100);
        if (objPk400 != null && objFk100 != null) {
            try {
                K400Store store = new K400Store();
                store.updateK450(Integer.parseInt(objPk400.toString()), Integer.parseInt(objFk100.toString()), "K100", null, getLogin().getUserName());
                sendRedirect("cuscompany.jsp");
                showGlobalReport(true, getResourceString("datasavesuccessful"));

            } catch (IllegalAccessException ex) {

                java.util.logging.Logger.getLogger(CustomerController.class.getName()).log(Level.SEVERE, null, ex);
                sendRedirect("cuscompany.jsp");
                showGlobalReport(true, getResourceString("datasuccessfail"));
            }
        }

    }

    public void searchAlphaCompany() {
        try {
            if (ContextUtil.getRequestParameter("idSearch") != null) {
                if (getLogin().getCharacter() != null || ContextUtil.getRequestParameter("idSearch").toString().equals(getLogin().getCharacter())) {
                    setTypeSearch(0);
                    setKeySearch(ContextUtil.getRequestParameter("idSearch").toString());

                    SessionProvider.setSessionMapValue("submitSearch", "true");
                } else {
                    setTypeSearch(0);
                    SessionProvider.setSessionMapValue("submitSearch", "false");
                }
            }
            setIdSearch(ContextUtil.getRequestParameter("idSearch"));
            if (getIdSearch() != null && getIdSearch().contains("ALL")) {
                setIdSearch(null);
                getLogin().setCharacter(getIdSearch());
            } else if (getIdSearch() == null) {
                getLogin().setCharacter(getIdSearch());
            } else {
                getLogin().setCharacter(getIdSearch());
            }

        } catch (Exception ex) {
            setIdSearch("ALL");
        }

    }

    public void saveColumnK100() {
        try {


            CustomerStore store = new CustomerStore();
            if (flag.equals("K100")) {

                store.updateColumnN100(null, "K100", "KV102", KV104, "PK100", PK100, getLogin().getUserName());


                showGlobalReport(true, getResourceString("datasavesuccessful"));
            } else if (flag.equals("N100")) {
                store.updateColumnN100(null, "N100", "NV113", KV104, "PN100", PK100, getLogin().getUserName());

                showGlobalReport(true, getResourceString("datasavesuccessful"));
            } else if (flag.equals("star")) {
                store.updateColumnINT(null, "N100", "NI105", ni105, "PN100", pn100, getLogin().getUserName());
                System.out.println("--update start---" + null + "," + "N100" + "," + "NI105" + "," + ni105 + "," + "PN100" + "," + pn100 + "," + getLogin().getUserName());
            } else if (flag.equals("starcustomer")) {
                store.updateColumnINT(null, "K100", "KV110", ni105, "PK100", pn100, getLogin().getUserName());
            } else if (flag.equals("K100S")) {
                store.updateColumnN100(null, "K100", "KV102", KV104, "PK100", PK100, getLogin().getUserName());

                showGlobalReport(true, getResourceString("datasavesuccessful"));
            }


        } catch (Exception ex) {
            System.out.println("------------->error" + ex.getMessage());
            showGlobalReport(true, getResourceString("datasuccessfail"));
        }
        if (flag.equals("K100")) {
            sendRedirectUrlTab("cuscompany.jsp?pnPK100=" + PK100 + "&" + Util.convertMD5(getRequest().getRequestURI()));
        }
        if (flag.equals("N100")) {
            sendRedirectUrlTab("customer.jsp?pnPN100=" + PK100 + "&" + Util.convertMD5(getRequest().getRequestURI()));
        }
        if (flag.equals("K100S")) {
            sendRedirect("supplier.jsp");
        }

    }

    // Tung
    public void saveN950() {
        try {
            ContactStore store = new ContactStore();
            int roweffect = 0;
            Object PK100new = SessionProvider.getSessionMapValue("PK100SS");
            if (PK100new != null) {
                PK100 = Integer.parseInt(PK100new.toString());
            }
            Object id = SessionProvider.getSessionMapValue("PN950");
            if (id != null) {
                pn950 = Integer.parseInt(id.toString());
            }
            //  System.out.println("-----id--aaaa--------" + PK100 + pn950);
            roweffect = store.updateN950By(this.PK100, pn950, "K100", this.nv952,
                    null, this.nv954, this.nv955, null, this.nv957, 1, this.nv958, null, this.nv960, this.nv961,
                    this.nv962, null, null, null, null, this.nv967, this.nv968, this.nv969, null, null, 1, nv973, nv974, nv975, getLogin().getUserName());
            if (roweffect > 0) {
                setMessagecom(" Dữ liệu cập nhật thành công");
                // showGlobalReport(true, getResourceString("datasavesuccessful"));
            } else {
                setMessagecom("Cập nhật không thành công");
                // showGlobalReport(true, getResourceString("datasuccessfail"));
            }

        } catch (Exception ex) {
        }
    }

    public void saveAccount() {
        try {
            Object pn100new = SessionProvider.getSessionMapValue("PK100SS");
            if (pn100new != null) {
                PK100 = Integer.parseInt(pn100new.toString());
            }
            Object id = SessionProvider.getSessionMapValue("PT025");
            if (id != null) {
                pt025 = Integer.parseInt(id.toString());
            }
            T025Store store = new T025Store();
            //  System.out.println("PK100-----0000000000000000000000-" + PK100 + pt025);
            if (!TV027.equals("") && !TV029.equals("")) {
                int count = store.updateT025(pt025, PK100, "K100", TV027, TV028, TV029, TV030, 0, 0, 0, getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
                if (count > 0) {
                    setMessagecom("Dữ liệu cập nhật thành công!");
                } else {
                    setMessagecom("Cập nhật không thành công!");
                }
            }

        } catch (Exception ex) {
            System.out.println("ERROR:---" + ex.getMessage());
        }

    }

    public void changeGroupOther(ActionEvent ac) {
        System.out.println("changeGroupOther---: " + fk400);
//        SessionProvider.setSessionMapValue("groupOther", fk400); 


    }

    public void getDetailFrominExpandN950(int id) {
        try {
            K950Store store = new K950Store();

            List<K950V> listN950 = store.getListTabK950(id, 1, getLogin().getUserName());
            if (listN950.size() > 0) {

                //    System.out.println("------ttttttttttttttaaaaaaaaaaaa------->>" + listN950.get(0).getADRID());
                // this.email = listN950.get(0).getEML1();
//                this.mobi = listN950.get(0).getMOB2();
//                this.tel = listN950.get(0).getTEL1();
//                this.notice = listN950.get(0).getTEL3();
                this.PK100 = listN950.get(0).getADRID();
                this.nv952 = listN950.get(0).getStr1();
                this.nv954 = listN950.get(0).getWARD();
                this.nv955 = listN950.get(0).getDIST();
                this.nv957 = listN950.get(0).getCITY();
                this.nv967 = listN950.get(0).getEML1();
                this.nv958 = listN950.get(0).getTEL1();
                this.nv962 = listN950.get(0).getMOB2();
                this.nv961 = listN950.get(0).getMOB1();
                this.nv968 = listN950.get(0).getEML2();
                this.nv969 = listN950.get(0).getEML3();
                // this.notice =

            }
        } catch (Exception e) {
        }
    }

    public void getListT025All(int id) {
        try {
            T025Store t025Store = new T025Store();

            List<T025> listT025i = t025Store.getListT025All(1, id, "K100", getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            if (listT025i != null && listT025i.size() > 0) {
                // this.setPT025(listT025.get(0).getPT025());
                this.setPK100(listT025i.get(0).getREFID());
                this.TV026 = listT025i.get(0).getTV026();
                this.setTV027(listT025i.get(0).getTV027());
                this.setTV028(listT025i.get(0).getTV028());
                this.setTV029(listT025i.get(0).getTV029());
                this.setTV030(listT025i.get(0).getTV030());
            }


        } catch (Exception ex) {
        }
    }

    public void updateNote() {
        CustomerStore customerStore = new CustomerStore();
        if (SessionProvider.getSessionMapValue("IDTIPTIP") != null) {
            tip = Util.parseInt(SessionProvider.getSessionMapValue("IDTIPTIP"));
        }
        if (tip == 1) {
            if (this.getPK100() > 0) {
                customerStore.updateColumnN100(null, "K100", "KV101", this.getKV101(), "PK100", this.getPK100(), getLogin().getUserName());
                showGlobalReport(true, getResourceString("success"));
                sendRedirect("supplier.jsp?linkhref=" + getKapiMenu().getMd5url());
            } else {
                showGlobalReport(true, getResourceString("error"));
                sendRedirect("supplier.jsp?linkhref=" + getKapiMenu().getMd5url());
            }
        } else {
            if (this.getPK100() > 0) {
                customerStore.updateColumnN100(null, "K100", "KV101", this.getKV101(), "PK100", this.getPK100(), getLogin().getUserName());
                showGlobalReport(true, getResourceString("success"));
                sendRedirect("cuscompany.jsp?linkhref=" + getKapiMenu().getMd5url());
            } else {
                showGlobalReport(true, getResourceString("error"));
                sendRedirect("cuscompany.jsp?linkhref=" + getKapiMenu().getMd5url());
            }

        }
    }

    // action tim kiem
    public void reloadform(ActionEvent event) {
        System.out.println("Chuoi tim kiem of tung" + searchString);

    }
    // khi co key thi ham se xuat hien

    // End
    /**
     * @return the k100Inf
     */
    public K100Inf getK100Inf() {
        return k100Inf;
    }

    /**
     * @param k100Inf the k100Inf to set
     */
    public void setK100Inf(K100Inf k100Inf) {
        this.k100Inf = k100Inf;
    }

    /**
     * @return the PK100
     */
    public int getPK100() {
        return PK100;
    }

    /**
     * @param PK100 the PK100 to set
     */
    public void setPK100(int PK100) {
        this.PK100 = PK100;
    }

    /**
     * @return the FH200
     */
    public int getFH200() {
        return FH200;
    }

    /**
     * @param FH200 the FH200 to set
     */
    public void setFH200(int FH200) {
        this.FH200 = FH200;
    }

    /**
     * @return the FK200
     */
    public int getFK200() {
        return FK200;
    }

    /**
     * @param FK200 the FK200 to set
     */
    public void setFK200(int FK200) {
        this.FK200 = FK200;
    }

    /**
     * @return the FK250
     */
    public int getFK250() {
        return FK250;
    }

    /**
     * @param FK250 the FK250 to set
     */
    public void setFK250(int FK250) {
        this.FK250 = FK250;
    }

    /**
     * @return the FK300
     */
    public int getFK300() {
        return FK300;
    }

    /**
     * @param FK300 the FK300 to set
     */
    public void setFK300(int FK300) {
        this.FK300 = FK300;
    }

    /**
     * @return the FK400
     */
    public int getFK400() {
        return FK400;
    }

    /**
     * @param FK400 the FK400 to set
     */
    public void setFK400(int FK400) {
        this.FK400 = FK400;
    }

    /**
     * @return the FK350
     */
    public int getFK350() {
        return FK350;
    }

    /**
     * @param FK350 the FK350 to set
     */
    public void setFK350(int FK350) {
        this.FK350 = FK350;
    }

    /**
     * @return the KV101
     */
    public String getKV101() {
        return KV101;
    }

    /**
     * @param KV101 the KV101 to set
     */
    public void setKV101(String KV101) {
        this.KV101 = KV101;
    }

    /**
     * @return the KV102
     */
    public String getKV102() {
        return KV102;
    }

    /**
     * @param KV102 the KV102 to set
     */
    public void setKV102(String KV102) {
        this.KV102 = KV102;
    }

    /**
     * @return the KV103
     */
    public String getKV103() {
        return KV103;
    }

    /**
     * @param KV103 the KV103 to set
     */
    public void setKV103(String KV103) {
        this.KV103 = KV103;
    }

    /**
     * @return the KV104
     */
    public String getKV104() {
        if (KV104 == null || KV104.isEmpty()) {
            KV104 = getLogin().getUserName();
        }
        return KV104;
    }

    /**
     * @param KV104 the KV104 to set
     */
    public void setKV104(String KV104) {
        this.KV104 = KV104;
    }

    /**
     * @return the KV105
     */
    public String getKV105() {
        return KV105;
    }

    /**
     * @param KV105 the KV105 to set
     */
    public void setKV105(String KV105) {
        this.KV105 = KV105;
    }

    /**
     * @return the KV106
     */
    public String getKV106() {
        return KV106;
    }

    /**
     * @param KV106 the KV106 to set
     */
    public void setKV106(String KV106) {
        this.KV106 = KV106;
    }

    /**
     * @return the KV107
     */
    public String getKV107() {
        return KV107;
    }

    /**
     * @param KV107 the KV107 to set
     */
    public void setKV107(String KV107) {
        this.KV107 = KV107;
    }

    /**
     * @return the KV108
     */
    public String getKV108() {
        return KV108;
    }

    /**
     * @param KV108 the KV108 to set
     */
    public void setKV108(String KV108) {
        this.KV108 = KV108;
    }

    /**
     * @return the KV109
     */
    public String getKV109() {
        return KV109;
    }

    /**
     * @param KV109 the KV109 to set
     */
    public void setKV109(String KV109) {
        this.KV109 = KV109;
    }

    /**
     * @return the KV110
     */
    public String getKV110() {
        return KV110;
    }

    /**
     * @param KV110 the KV110 to set
     */
    public void setKV110(String KV110) {
        this.KV110 = KV110;
    }

    /**
     * @return the KV111
     */
    public String getKV111() {
        return KV111;
    }

    /**
     * @param KV111 the KV111 to set
     */
    public void setKV111(String KV111) {
        this.KV111 = KV111;
    }

    /**
     * @return the KV112
     */
    public String getKV112() {
        return KV112;
    }

    /**
     * @param KV112 the KV112 to set
     */
    public void setKV112(String KV112) {
        this.KV112 = KV112;
    }

    /**
     * @return the FH200Q
     */
    public int getFH200Q() {
        return FH200Q;
    }

    /**
     * @param FH200Q the FH200Q to set
     */
    public void setFH200Q(int FH200Q) {
        this.FH200Q = FH200Q;
    }

    /**
     * @return the FH150
     */
    public int getFH150() {
        return FH150;
    }

    /**
     * @param FH150 the FH150 to set
     */
    public void setFH150(int FH150) {
        this.FH150 = FH150;
    }

    /**
     * @return the FV350
     */
    public int getFV350() {
        return FV350;
    }

    /**
     * @param FV350 the FV350 to set
     */
    public void setFV350(int FV350) {
        this.FV350 = FV350;
    }

    /**
     * @return the KL197
     */
    public String getKL197() {
        return KL197;
    }

    /**
     * @param KL197 the KL197 to set
     */
    public void setKL197(String KL197) {
        this.KL197 = KL197;
    }

//    /**
//     * @return the list
//     */
//    public List<K100> getList() {
//
//        if (list.isEmpty() && edit != 1) {
//            //    getdata(PK100);
//
//            for (int i = 0; i < list.size(); i++) {
//
//                if (i < 10) {
//                    list.get(i).setNumber("00" + (i + 1));
//                } else if (i < 100) {
//                    list.get(i).setNumber("0" + (i + 1));
//                } else {
//                    list.get(i).setNumber("" + (i + 1));
//                }
//
//            }
//        }
//
//
//        return list;
//    }
    /**
     * @param list the list to set
     */
    public void setList(List<K100> list) {

        this.list = list;
    }

    /**
     * @return the KN114
     */
    public int getKN114() {
        if (SessionProvider.getSessionMapValue("companytype") == null) {
            SessionProvider.setSessionMapValue("companytype", 0);
        } else if (SessionProvider.getSessionMapValue("KV114type") != null) {
            KN114 = Integer.parseInt(SessionProvider.getSessionMapValue("KV114type").toString());

        }

        return KN114;
    }

    /**
     * @param KN114 the KN114 to set
     */
    public void setKN114(int KN114) {
        this.KN114 = KN114;
    }

    /**
     * @return the combN850
     */
    public List<SelectItem> getCombN850() {
        if (combN850 == null || combN850.size() == 0) {
            combN850 = comboboxUtil.getSelectedN850Comb();
            // combN900 = comboboxUtil.getSelectedN900Comb(0);
        }

        return combN850;
    }

    /**
     * @param combN850 the combN850 to set
     */
    public void setCombN850(List<SelectItem> combN850) {
        this.combN850 = combN850;
    }

    /**
     * @return the FN850
     */
    public int getFN850() {
        if (FN850 == 0) {
            FN850 = getLogin().getFn850();
        }
        return FN850;
    }

    /**
     * @param FN850 the FN850 to set
     */
    public void setFN850(int FN850) {
        this.FN850 = FN850;
    }

    /**
     * @return the combN900
     */
    public List<SelectItem> getCombN900() {
        System.out.println("---------AAAAAAAAAAAAAAAAAAA------------ :" + FN850);
        combN900 = comboboxUtil.getSelectedN900Comb(FN850);
        return combN900;
    }

    /**
     * @param combN900 the combN900 to set
     */
    public void setCombN900(List<SelectItem> combN900) {
        this.combN900 = combN900;
    }

    /**
     * @return the FN900
     */
    public int getFN900() {
        return FN900;
    }

    /**
     * @param FN900 the FN900 to set
     */
    public void setFN900(int FN900) {
        this.FN900 = FN900;
    }

    /**
     * @return the flag
     */
    public String getFlag() {
        return flag;
    }

    /**
     * @param flag the flag to set
     */
    public void setFlag(String flag) {
        this.flag = flag;
    }

    /**
     * @return the combN550
     */
    public List<SelectItem> getCombN550() {
        combN550 = comboboxUtil.getSelectedN550Comb();
        return combN550;
    }

    /**
     * @param combN550 the combN550 to set
     */
    public void setCombN550(List<SelectItem> combN550) {
        this.setCombN550(combN550);
    }

    /**
     * @return the FN550
     */
    public int getFN550() {
        return FN550;
    }

    /**
     * @param FN550 the FN550 to set
     */
    public void setFN550(int FN550) {
        this.FN550 = FN550;
    }

    /**
     * @return the beginContructor
     */
    public int getBeginContructor() {
        return beginContructor;
    }

    /**
     * @param beginContructor the beginContructor to set
     */
    public void setBeginContructor(int beginContructor) {
        this.beginContructor = beginContructor;
    }

    /**
     * @return the ni105
     */
    public int getNi105() {
        return ni105;
    }

    /**
     * @param ni105 the ni105 to set
     */
    public void setNi105(int ni105) {
        this.ni105 = ni105;
    }

    /**
     * @return the pn100
     */
    public int getPn100() {
        return pn100;
    }

    /**
     * @param pn100 the pn100 to set
     */
    public void setPn100(int pn100) {
        this.pn100 = pn100;
    }

    /**
     * @return the idSearch
     */
    public String getIdSearch() {
        return idSearch;
    }

    /**
     * @param idSearch the idSearch to set
     */
    public void setIdSearch(String idSearch) {
        this.idSearch = idSearch;
    }

    public void searchAlpha() {
        try {
            setIdSearch(ContextUtil.getRequestParameter("idSearch"));
            if (getIdSearch() != null && getIdSearch().contains("ALL")) {
                setIdSearch(null);
            }
            getLogin().setCharacter(getIdSearch());
        } catch (Exception ex) {
            setIdSearch("ALL");
        }

    }

    /**
     * @return the KB113
     */
    public byte[] getKB113() {
        return KB113;
    }

    /**
     * @param KB113 the KB113 to set
     */
    public void setKB113(byte[] KB113) {
        this.KB113 = KB113;
    }

    /**
     * @return the logo
     */
    public Blob getLogo() {
        return logo;
    }

    /**
     * @param logo the logo to set
     */
    public void setLogo(Blob logo) {
        this.logo = logo;
    }

    /**
     * @return the charSearch
     */
    public String getCharSearch() {
        if (SessionProvider.getSessionMapValue("search4cuscompany") != null) {
            charSearch = SessionProvider.getSessionMapValue("search4cuscompany").toString();
        }
        return charSearch;
    }

    /**
     * @param charSearch the charSearch to set
     */
    public void setCharSearch(String charSearch) {
        this.charSearch = charSearch;
    }

    /**
     * @return the keySearch
     */
    public String getKeySearch() {
        return keySearch;
    }

    /**
     * @param keySearch the keySearch to set
     */
    public void setKeySearch(String keySearch) {
        this.keySearch = keySearch;
    }

    /**
     * @return the typeSearch
     */
    public int getTypeSearch() {
        return typeSearch;
    }

    /**
     * @param typeSearch the typeSearch to set
     */
    public void setTypeSearch(int typeSearch) {
        this.typeSearch = typeSearch;
    }

    /**
     * @return the listQ400
     */
    public List<Q400> getListQ400() {
        return listQ400;
    }

    /**
     * @param listQ400 the listQ400 to set
     */
    public void setListQ400(List<Q400> listQ400) {
        this.listQ400 = listQ400;
    }

    /**
     * @return the pk100
     */
    public int getPk100() {
        return pk100;
    }

    /**
     * @param pk100 the pk100 to set
     */
    public void setPk100(int pk100) {
        this.pk100 = pk100;
    }

    /**
     * @return the messagecom
     */
    public String getMessagecom() {
        return messagecom;
    }

    /**
     * @param messagecom the messagecom to set
     */
    public void setMessagecom(String messagecom) {
        this.messagecom = messagecom;
    }

    /**
     * @return the pn950
     */
    public int getPn950() {
        return pn950;
    }

    /**
     * @param pn950 the pn950 to set
     */
    public void setPn950(int pn950) {
        this.pn950 = pn950;
    }

    /**
     * @return the nv958
     */
    public String getNv958() {
        return nv958;
    }

    /**
     * @param nv958 the nv958 to set
     */
    public void setNv958(String nv958) {
        this.nv958 = nv958;
    }

    /**
     * @return the nv961
     */
    public String getNv961() {
        return nv961;
    }

    /**
     * @param nv961 the nv961 to set
     */
    public void setNv961(String nv961) {
        this.nv961 = nv961;
    }

    /**
     * @return the nv967
     */
    public String getNv967() {
        return nv967;
    }

    /**
     * @param nv967 the nv967 to set
     */
    public void setNv967(String nv967) {
        this.nv967 = nv967;
    }

    /**
     * @return the nv968
     */
    public String getNv968() {
        return nv968;
    }

    /**
     * @param nv968 the nv968 to set
     */
    public void setNv968(String nv968) {
        this.nv968 = nv968;
    }

    /**
     * @return the nv969
     */
    public String getNv969() {
        return nv969;
    }

    /**
     * @param nv969 the nv969 to set
     */
    public void setNv969(String nv969) {
        this.nv969 = nv969;
    }

    /**
     * @return the nv952
     */
    public String getNv952() {
        return nv952;
    }

    /**
     * @param nv952 the nv952 to set
     */
    public void setNv952(String nv952) {
        this.nv952 = nv952;
    }

    /**
     * @return the nv955
     */
    public String getNv955() {
        return nv955;
    }

    /**
     * @param nv955 the nv955 to set
     */
    public void setNv955(String nv955) {
        this.nv955 = nv955;
    }

    /**
     * @return the nv957
     */
    public String getNv957() {
        return nv957;
    }

    /**
     * @param nv957 the nv957 to set
     */
    public void setNv957(String nv957) {
        this.nv957 = nv957;
    }

    /**
     * @return the nv960
     */
    public String getNv960() {
        return nv960;
    }

    /**
     * @param nv960 the nv960 to set
     */
    public void setNv960(String nv960) {
        this.nv960 = nv960;
    }

    /**
     * @return the nv954
     */
    public String getNv954() {
        return nv954;
    }

    /**
     * @param nv954 the nv954 to set
     */
    public void setNv954(String nv954) {
        this.nv954 = nv954;
    }

    /**
     * @return the nv962
     */
    public String getNv962() {
        return nv962;
    }

    /**
     * @param nv962 the nv962 to set
     */
    public void setNv962(String nv962) {
        this.nv962 = nv962;
    }

    /**
     * @return the TV026
     */
    public String getTV026() {
        return TV026;
    }

    /**
     * @param TV026 the TV026 to set
     */
    public void setTV026(String TV026) {
        this.TV026 = TV026;
    }

    /**
     * @return the TV027
     */
    public String getTV027() {
        return TV027;
    }

    /**
     * @param TV027 the TV027 to set
     */
    public void setTV027(String TV027) {
        this.TV027 = TV027;
    }

    /**
     * @return the TV028
     */
    public String getTV028() {
        return TV028;
    }

    /**
     * @param TV028 the TV028 to set
     */
    public void setTV028(String TV028) {
        this.TV028 = TV028;
    }

    /**
     * @return the TV029
     */
    public String getTV029() {
        return TV029;
    }

    /**
     * @param TV029 the TV029 to set
     */
    public void setTV029(String TV029) {
        this.TV029 = TV029;
    }

    /**
     * @return the TV030
     */
    public String getTV030() {
        return TV030;
    }

    /**
     * @param TV030 the TV030 to set
     */
    public void setTV030(String TV030) {
        this.TV030 = TV030;
    }

    /**
     * @return the pt025
     */
    public int getPt025() {
        return pt025;
    }

    /**
     * @param pt025 the pt025 to set
     */
    public void setPt025(int pt025) {
        this.pt025 = pt025;
    }

    /**
     * @return the searchString
     */
    public String getSearchString() {
        return searchString;
    }

    /**
     * @param searchString the searchString to set
     */
    public void setSearchString(String searchString) {
        this.searchString = searchString;
    }

    /**
     * @return the listExpand
     */
//    public void saveSelected() {
//        System.out.println("---select+++++++++++++" + PK100);
//        CustomerStore store = new CustomerStore();
//        for (int i = 0; i < listExpand.size(); i++) {
//            System.out.println("---select+++++++++++++" + listExpand.get(i).isSelected());
//            try {
//                if (listExpand.get(i).isSelected()) {
//                    int rs = store.updateColumnN100(null, "N100", "FK100", String.valueOf(PK100), "PN100", listExpand.get(i).getPn100(), getLogin().getUserName());
//                }
//            } catch (Exception ex) {
//            }
//
//        }
//    }
//    public List<N100> getListExpand() {
//        if (searchString.contains("Nhập từ khóa")) {
//            searchString = "";
//        }
//
//        EmployeeStore store = new EmployeeStore();
//        listExpand = store.getListComN100Name(getLogin().getModule(), getLogin().getCompanyNo(), 0, 0, searchString, getLogin().getUserName());
//        System.out.println("List cua TungGGGGGGGGGGG" + listExpand.size());
//
//        return listExpand;
//
//    }
    public List<N100> getListExpand() {
        if (searchString.contains("Nhập từ khóa")) {
            searchString = "";
        }

        EmployeeStore store = new EmployeeStore();
        List<N100> lst = store.getListComN100Name(getLogin().getModule(), getLogin().getCompanyNo(), 0, 0, searchString, 0, 1, 0, 0, getLogin().getUserName());
        int total = 0;
        if (lst != null && lst.size() > 0) {
            total = lst.get(0).getRowss();
        }
        listExpand = store.getListComN100Name(getLogin().getModule(), getLogin().getCompanyNo(), 0, 0, searchString, 0, total, 0, 0, getLogin().getUserName());
        System.out.println("List cua Tung" + listExpand.size());

        return listExpand;

    }

    /**
     * @param listExpand the listExpand to set
     */
    public void setListExpand(List<N100> listExpand) {
        this.listExpand = listExpand;
    }

    /**
     * @return the listComboK300
     */
    public List<SelectItem> getListComboK300() {
        ComboboxUtil com = new ComboboxUtil();
        listComboK300 = com.getlistCombK300("K");
        return listComboK300;
    }

    /**
     * @param listComboK300 the listComboK300 to set
     */
    public void setListComboK300(List<SelectItem> listComboK300) {
        this.listComboK300 = listComboK300;
    }

    /**
     * @return the listComboK330
     */
    public List<SelectItem> getListComboK330() {
        ComboboxUtil com = new ComboboxUtil();
        listComboK330 = com.getlistCombK330("K");
        return listComboK330;
    }

    /**
     * @param listComboK330 the listComboK330 to set
     */
    public void setListComboK330(List<SelectItem> listComboK330) {
        this.listComboK330 = listComboK330;
    }

    /**
     * @return the FK330
     */
    public int getFK330() {
        return FK330;
    }

    /**
     * @param FK330 the FK330 to set
     */
    public void setFK330(int FK330) {
        this.FK330 = FK330;
    }

    /**
     * @return the Offset
     */
    public int getOffset() {
        return Offset;
    }

    /**
     * @param Offset the Offset to set
     */
    public void setOffset(int Offset) {
        this.Offset = Offset;
    }

    /**
     * @return the Limit
     */
    public int getLimit() {
        return Limit;
    }

    /**
     * @param Limit the Limit to set
     */
    public void setLimit(int Limit) {
        this.Limit = Limit;
    }

    // property for paging
    /**
     * @return the current
     */
    public int getCurrent() {
        if (current > totalpage) {
            current = totalpage;
        } else if (current < 1) {
            current = 1;
        }
        return current;
    }

    /**
     * @param current the current to set
     */
    public void setCurrent(int current) {

        start = (current - 1) * getNumrow();
        end = current * numrow;
        this.current = current;
    }

    /**
     * @return the numrow
     */
    public int getNumrow() {
        if (numrow == 0) {
            numrow = 30;
        }
        return numrow;
    }

    /**
     * @param numrow the numrow to set
     */
    public void setNumrow(int numrow) {
        this.numrow = numrow;
    }

    /**
     * @return the start
     */
    public int getStart() {
        if (start == 0) {
            start = 1;
        }
        return start;
    }

    /**
     * @param start the start to set
     */
    public void setStart(int start) {
        this.start = start;
    }

    /**
     * @return the end
     */
    public int getEnd() {
        if (end == 0) {
            end = 20;
        }
        return end;
    }

    /**
     * @param end the end to set
     */
    public void setEnd(int end) {
        this.end = end;
    }

    /**
     * @return the totalrow
     */
    public int getTotalrow() {
        return totalrow;
    }

    /**
     * @param totalrow the totalrow to set
     */
    public void setTotalrow(int totalrow) {
//        if (totalrow == 0) {
//            totalrow = 100;
//        }
        totalpage = totalrow / numrow;

        if (totalrow % numrow > 0) {
            totalpage = totalpage + 1;
        }


        if (getTotalpage() <= 10) {
            setStartpage(1);
            setEndpage(getTotalpage());

        } else {
            setStartpage(current - 5);
            setEndpage(current + 5);


        }
        this.totalrow = totalrow;
    }

    /**
     * @return the startpage
     */
    public int getStartpage() {
        if (startpage < 1) {
            startpage = 1;
        }
        return startpage;
    }

    /**
     * @param startpage the startpage to set
     */
    public void setStartpage(int startpage) {
        this.startpage = startpage;
    }

    /**
     * @return the endpage
     */
    public int getEndpage() {
        if (endpage > totalpage) {
            endpage = totalpage;
        }
        return endpage;
    }

    /**
     * @param endpage the endpage to set
     */
    public void setEndpage(int endpage) {

        this.endpage = endpage;
    }

    /**
     * @return the totalpage
     */
    public int getTotalpage() {
//        if (totalpage == 0) {
//            totalpage = 10;
//        }
        return totalpage;
    }

    /**
     * @param totalpage the totalpage to set
     */
    public void setTotalpage(int totalpage) {
        this.totalpage = totalpage;
    }

    /**
     * @return the pagename
     */
    public String getPagename() {
        return pagename;
    }

    /**
     * @param pagename the pagename to set
     */
    public void setPagename(String pagename) {
        this.pagename = pagename;
    }

    /**
     * @return the totalcurent
     */
    public int getTotalcurent() {
        return totalcurent;
    }

    /**
     * @param totalcurent the totalcurent to set
     */
    public void setTotalcurent(int totalcurent) {
        this.totalcurent = totalcurent;
    }

    /**
     * @return the typesearchcurent
     */
    public int getTypesearchcurent() {
        return typesearchcurent;
    }

    /**
     * @param typesearchcurent the typesearchcurent to set
     */
    public void setTypesearchcurent(int typesearchcurent) {
        this.typesearchcurent = typesearchcurent;
    }

    /**
     * @return the groupID
     */
    public int getGroupID() {
        return groupID;
    }

    /**
     * @param groupID the groupID to set
     */
    public void setGroupID(int groupID) {
        this.groupID = groupID;
    }

    /**
     * @return the fk400
     */
    public int getFk400() {
        return fk400;
    }

    /**
     * @param fk400 the fk400 to set
     */
    public void setFk400(int fk400) {
        this.fk400 = fk400;
    }

    /**
     * @return the kv451
     */
    public String getKv451() {
        return kv451;
    }

    /**
     * @param kv451 the kv451 to set
     */
    public void setKv451(String kv451) {
        this.kv451 = kv451;
    }

    /**
     * @return the select
     */
    public boolean isSelect() {
        return select;
    }

    /**
     * @param select the select to set
     */
    public void setSelect(boolean select) {
        this.select = select;
    }

    /**
     * @return the tip
     */
    public int getTip() {
        if (SessionProvider.getSessionMapValue("idselect") != null) {
            tip = Util.parseInt(SessionProvider.getSessionMapValue("idselect"));
        } else {
            tip = 0;
        }
        return tip;
    }

    /**
     * @param tip the tip to set
     */
    public void setTip(int tip) {
        this.tip = tip;
    }

    /**
     * @return the fn850gt
     */
    public int getFn850gt() {
        return fn850gt;
    }

    /**
     * @param fn850gt the fn850gt to set
     */
    public void setFn850gt(int fn850gt) {
        this.fn850gt = fn850gt;
    }

    /**
     * @return the pagecurent
     */
    public String getPagecurent() {
        return pagecurent;
    }

    /**
     * @param pagecurent the pagecurent to set
     */
    public void setPagecurent(String pagecurent) {
        this.pagecurent = pagecurent;
    }

    /**
     * @return the groupOther
     */
    public List<SelectItem> getGroupOther() {
        if (groupOther != null && groupOther.size() > 0) {
            return groupOther;
        } else {
            return comboboxUtil.getListCombK400F("K100S");
        }
    }

    /**
     * @param groupOther the groupOther to set
     */
    public void setGroupOther(List<SelectItem> groupOther) {
        this.groupOther = groupOther;
    }

    /**
     * @return the dayss
     */
    public int getDayss() {
        return dayss;
    }

    /**
     * @param dayss the dayss to set
     */
    public void setDayss(int dayss) {
        this.dayss = dayss;
    }

    /**
     * @return the lstEmpByID
     */
    public List<SelectItem> getLstEmpByID() {
        String emp = loginEmp;
        try {
            if (lstEmpByID == null || lstEmpByID.size() < 1) {
                lstEmpByID = comboboxUtil.getSelectedN900Comb(fn850);
                for (int i = 0; i < lstEmpByID.size(); i++) {
                    if (lstEmpByID.get(i).getValue().toString().equals(loginEmp)) {
                        //neu nhan vien dc chon co trong nhom to
                        emp = lstEmpByID.get(i).getValue().toString();
                        break;
                    } else {//neu ko co thi gan la ng dau tien
                        emp = lstEmpByID.get(0).getValue().toString();
                    }
                }
                loginEmp = emp;
                if (flagFN850 == 10) {
                    userAction = emp;
                }
                SessionProvider.setSessionMapValue("emp", loginEmp);
            }

        } catch (Exception e) {
            System.out.println("getLstEmpByID error--:" + e.getMessage());
            lstEmpByID = new ArrayList<SelectItem>();
        }

        System.out.println("getLstEmpByID-size-" + lstEmpByID.size() + "---fn850--" + fn850 + "--emplogin--" + loginEmp + "--userAction--" + userAction);
        return lstEmpByID;
    }

    /**
     * @param lstEmpByID the lstEmpByID to set
     */
    public void setLstEmpByID(List<SelectItem> lstEmpByID) {
        this.lstEmpByID = lstEmpByID;
    }

    /**
     * @return the fn850
     */
    public int getFn850() {
        return fn850;
    }

    /**
     * @param fn850 the fn850 to set
     */
    public void setFn850(int fn850) {
        this.fn850 = fn850;
    }

    /**
     * @return the loginEmp
     */
    public String getLoginEmp() {
        return loginEmp;
    }

    /**
     * @param loginEmp the loginEmp to set
     */
    public void setLoginEmp(String loginEmp) {
        this.loginEmp = loginEmp;
    }

    /**
     * @return the userAction
     */
    public String getUserAction() {
        return userAction;
    }

    /**
     * @param userAction the userAction to set
     */
    public void setUserAction(String userAction) {
        this.userAction = userAction;
    }

    /**
     * @return the nv973
     */
    public String getNv973() {
        return nv973;
    }

    /**
     * @param nv973 the nv973 to set
     */
    public void setNv973(String nv973) {
        this.nv973 = nv973;
    }

    /**
     * @return the nv974
     */
    public String getNv974() {
        return nv974;
    }

    /**
     * @param nv974 the nv974 to set
     */
    public void setNv974(String nv974) {
        this.nv974 = nv974;
    }

    /**
     * @return the nv975
     */
    public String getNv975() {
        return nv975;
    }

    /**
     * @param nv975 the nv975 to set
     */
    public void setNv975(String nv975) {
        this.nv975 = nv975;
    }

    /**
     * @return the listCoutry
     */
    public List<SelectItem> getListCoutry() {

        return comboboxUtil.getlistCombN750DV();
    }

    /**
     * @param listCoutry the listCoutry to set
     */
    public void setListCoutry(List<SelectItem> listCoutry) {
        this.listCoutry = listCoutry;
    }

    /**
     * @return the listCity
     */
    public List<SelectItem> getListCity() {
        return comboboxUtil.getListCombA000_SP(1);
    }

    /**
     * @param listCity the listCity to set
     */
    public void setListCity(List<SelectItem> listCity) {
        this.listCity = listCity;
    }

    /**
     * @return the combN550CC
     */
    public List<SelectItem> getCombN550CC() {

        return comboboxUtil.getSelectedN550CombCC();
    }

    /**
     * @param combN550CC the combN550CC to set
     */
    public void setCombN550CC(List<SelectItem> combN550CC) {
        this.combN550CC = combN550CC;
    }

    /**
     * @return the FN750
     */
    public int getFN750() {
        return FN750;
    }

    /**
     * @param FN750 the FN750 to set
     */
    public void setFN750(int FN750) {
        this.FN750 = FN750;
    }

    /**
     * @return the typeSearchNCC
     */
    public int getTypeSearchNCC() {
        if (SessionProvider.getSessionMapValue("typeSearchK100") != null) {
            typeSearchNCC = Util.parseInt(SessionProvider.getSessionMapValue("typeSearchK100"));
        }
        return typeSearchNCC;
    }

    /**
     * @param typeSearchNCC the typeSearchNCC to set
     */
    public void setTypeSearchNCC(int typeSearchNCC) {
        this.typeSearchNCC = typeSearchNCC;
    }

    /**
     * @return the startDateSta
     */
    public Date getStartDateSta() {
        return startDateSta;
    }

    /**
     * @param startDateSta the startDateSta to set
     */
    public void setStartDateSta(Date startDateSta) {
        this.startDateSta = startDateSta;
    }

    /**
     * @return the endDateSta
     */
    public Date getEndDateSta() {
        return endDateSta;
    }

    /**
     * @param endDateSta the endDateSta to set
     */
    public void setEndDateSta(Date endDateSta) {
        this.endDateSta = endDateSta;
    }

    /**
     * @return the KD115
     */
    public Date getKD115() {
        return KD115;
    }

    /**
     * @param KD115 the KD115 to set
     */
    public void setKD115(Date KD115) {
        this.KD115 = KD115;
    }

    public void chooseTabll() {
        try {
            setTabString("TABLL");
            SessionProvider.setSessionMapValue("TABLL1", tabString);
            //      listSelected.clear();
//            if (SessionProvider.getSessionMapValue("listSelectedEx") != null) {
//                 SessionProvider.setSessionMapValue("listSelectedEx",null);
//             }
//             if(SessionProvider.getSessionMapValue("listN100") != null){
//                 SessionProvider.setSessionMapValue("listN100", null);
//             }

        } catch (Exception e) {
        }
    }

    public void chooseTabCM() {
        try {
            setTabString("TABCM");
            SessionProvider.setSessionMapValue("TABLL1", tabString);
//            listN500DB  = (List<N500>) SessionProvider.getSessionMapValue("listN500");
//            setTabString("TABCN");
            //listSelected.clear();
            if (SessionProvider.getSessionMapValue("listSelectedEx") != null) {
                SessionProvider.setSessionMapValue("listSelectedEx", null);
            }
            if (SessionProvider.getSessionMapValue("listN100") != null) {
                SessionProvider.setSessionMapValue("listN100", null);
            }
        } catch (Exception e) {
        }
    }

    public void chooseTabTK() {
        try {
            setTabString("TABTK");
            SessionProvider.setSessionMapValue("TABLL1", tabString);
        } catch (Exception e) {
        }
    }

    public void chooseTabTL() {
        try {
            setTabString("TABTL");
            SessionProvider.setSessionMapValue("TABLL1", tabString);
        } catch (Exception e) {
        }
    }

    public void chooseTabLSKH() {
        try {
            setTabString("TABLSKH");
            SessionProvider.setSessionMapValue("TABLL1", tabString);
        } catch (Exception e) {
        }
    }

    public void chooseTabLST() {
        try {
            setTabString("TABLST");
            SessionProvider.setSessionMapValue("TABLL1", tabString);
        } catch (Exception e) {
        }
    }

    public void chooseTabLSCN() {
        try {
            setTabString("TABLSCN");
            SessionProvider.setSessionMapValue("TABLL1", tabString);
        } catch (Exception e) {
        }
    }

    /**
     * @return the tabString
     */
    public String getTabString() {
        if (SessionProvider.getSessionMapValue("TABLL1") != null) {
            tabString = SessionProvider.getSessionMapValue("TABLL1").toString();
        } else {
        }
        return tabString;
    }

    /**
     * @param tabString the tabString to set
     */
    public void setTabString(String tabString) {
        this.tabString = tabString;
    }

    /**
     * @return the rowdemo
     */
    public int getRowdemo() {
        return rowdemo;
    }

    /**
     * @param rowdemo the rowdemo to set
     */
    public void setRowdemo(int rowdemo) {
        this.rowdemo = rowdemo;
    }
}
